﻿using System;
using System.Collections.Generic;
using UnityEngine;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x02000EE0 RID: 3808
	internal class XArtsSkill : XSkill
	{
		// Token: 0x17003534 RID: 13620
		// (get) Token: 0x0600C9C3 RID: 51651 RVA: 0x002D64C0 File Offset: 0x002D46C0
		public override int SkillType
		{
			get
			{
				return 1;
			}
		}

		// Token: 0x17003535 RID: 13621
		// (get) Token: 0x0600C9C4 RID: 51652 RVA: 0x002D64D4 File Offset: 0x002D46D4
		public override string AnimClipName
		{
			get
			{
				return this._data.ClipName;
			}
		}

		// Token: 0x0600C9C5 RID: 51653 RVA: 0x002D64F4 File Offset: 0x002D46F4
		public override void Initialize(XEntity firer)
		{
			base.Initialize(firer);
			this._fx.debugName = "XArtsSkill._fx";
			this._combined_fx.debugName = "XArtsSkill._combined_fx";
			this._mob_unit.debugName = "XArtsSkill._mob_unit";
			XSingleton<BufferPoolMgr>.singleton.GetSmallBuffer(ref this._fx, 16, 0);
			XSingleton<BufferPoolMgr>.singleton.GetSmallBuffer(ref this._mob_unit, 16, 0);
			XSingleton<BufferPoolMgr>.singleton.GetSmallBuffer(ref this._combined_fx, 16, 0);
		}

		// Token: 0x0600C9C6 RID: 51654 RVA: 0x002D6576 File Offset: 0x002D4776
		public override void Uninitialize()
		{
			base.Uninitialize();
			XSingleton<BufferPoolMgr>.singleton.ReturnSmallBuffer(ref this._fx);
			XSingleton<BufferPoolMgr>.singleton.ReturnSmallBuffer(ref this._mob_unit);
			XSingleton<BufferPoolMgr>.singleton.ReturnSmallBuffer(ref this._combined_fx);
		}

		// Token: 0x0600C9C7 RID: 51655 RVA: 0x002D65B4 File Offset: 0x002D47B4
		protected override bool InnerProcessTimer(object param, int id)
		{
			//bool flag = !base.InnerProcessTimer(param, id);
			XSingleton<XDebug>.singleton.AddLog("InnerProcessTimer -------------------- id: " + id, null, null, null, null, null);
			if (!base.InnerProcessTimer(param, id))
			{
				switch (id)
				{
				case 2: //EOnResult
					base.OnResult(param);
					return true;
				case 3: //EQTEOn
					this.QTEOn(param);
					return true;
				case 4: //EQTEOff
					this.QTEOff(param);
					return true;
				case 5: //EPreservedSAt
					this.PreservedSAt(param);
					return true;
				case 6: //EPreservedSEnd
					this.PreservedSEnd(param);
					return true;
				case 7: //ENotSelected
					this.NotSelected(param);
					return true;
				case 8: //EExString
					this.ExString(param);
					return true;
				case 9: //EManipulate
					this.Manipulate(param);
					return true;
				case 10: //EMob
					this.Mob(param);
					return true;
				case 11: //ECastChain
					this.CastChain(param);
					return true;
				case 12: //EFx
					this.Fx(param);
					return true;
				case 13: //EAudio
					this.Audio(param);
					return true;
				case 14: //EWarning
					this.Warning(param);
					return true;
				case 15: //ECharge
					this.Charge(param);
					return true;
				case 16: //EShake
					this.Shake(param);
					return true;
				case 17: //ECameraMotion
					this.CameraMotion(param);
					return true;
				case 18: //ECameraPostEffect
					this.CameraPostEffect(param);
					return true;
				case 19: //ESolidBlack
					this.SolidBlack(param);
					return true;
				case 20: //ELoopResults
					this.LoopResults(param);
					return true;
				case 21: //EGroupResults
					this.GroupResults(param);
					return true;
				case 22: //EKillManipulate
					this.KillManipulate(param);
					return true;
				case 23: //EKillFx
					this.KillFx(param);
					return true;
				case 24: //EEndCameraPostEffect
						this.EndCameraPostEffect(param);
					return true;
				}
			}
			return false;
		}

		// Token: 0x0600C9C8 RID: 51656 RVA: 0x002D6780 File Offset: 0x002D4980
		protected override void Start()
		{
			base.Start();
			this._set_camera_effect = false;
			this._set_camera_shake = false;
			this._set_not_selected = false;
			//bool needTarget = this._data.NeedTarget;
			if (this._data.NeedTarget)
			{
				base.FocusTarget(this._target);
				//bool isPlayer = this._firer.IsPlayer;
				if (this._firer.IsPlayer)
				{
					base.Manual();
				}
			}
			this.FireEvents();
		}

		// Token: 0x0600C9C9 RID: 51657 RVA: 0x002D67E8 File Offset: 0x002D49E8
		protected virtual void FireEvents()
		{
			XSingleton<XDebug>.singleton.AddLog("FireEvents --------------------: ", null, null, null, null, null);
			//bool flag = this._data.Result != null;
			if (this._data.Result != null)
			{
				for (int i = 0; i < this._data.Result.Count; i++)
				{
					//bool flag2 = this._data.Result[i].LongAttackEffect || !XSingleton<XGame>.singleton.SyncMode || !this._demonstration;
					if (this._data.Result[i].LongAttackEffect || !XSingleton<XGame>.singleton.SyncMode || !this._demonstration)
					{
						this._data.Result[i].Token = i;
						float at = this._data.Result[i].At;
						XSingleton<XDebug>.singleton.AddLog(" SetTimer EOnResult --------------------: ", null, null, null, null, null);
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(at * this._time_scale, this._TimerCallback, this._data.Result[i], XArtsSkill.EArtsSkillTimerCb.EOnResult), true);
					}
				}
			}
			//bool flag3 = this._data.Charge != null;
			if (this._data.Charge != null)
			{
				for (int j = 0; j < this._data.Charge.Count; j++)
				{
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>((this._data.Charge[j].Using_Curve ? 0f : this._data.Charge[j].At) * this._time_scale, this._TimerCallback, this._data.Charge[j], XArtsSkill.EArtsSkillTimerCb.ECharge), true);
				}
			}
			//bool flag4 = !this._demonstration && this._data.Logical != null;
			if (!this._demonstration && this._data.Logical != null)
			{
				//bool flag5 = this._data.Logical.QTEData != null;
				if (this._data.Logical.QTEData != null)
				{
					for (int k = 0; k < this._data.Logical.QTEData.Count; k++)
					{
						//bool flag6 = this._firer.QTE != null && this._data.Logical.QTEData[k].QTE != 0;
						if (this._firer.QTE != null && this._data.Logical.QTEData[k].QTE != 0)
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.QTEData[k].At * this._time_scale, this._TimerCallback, this._data.Logical.QTEData[k].QTE, XArtsSkill.EArtsSkillTimerCb.EQTEOn), true);
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.QTEData[k].End * this._time_scale, this._TimerCallback, this._data.Logical.QTEData[k].QTE, XArtsSkill.EArtsSkillTimerCb.EQTEOff), true);
						}
					}
				}
				//bool flag7 = this._core.PreservedStrength > 0;
				if (this._core.PreservedStrength > 0)
				{
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.PreservedAt * this._time_scale, this._TimerCallback, this._core.PreservedStrength, XArtsSkill.EArtsSkillTimerCb.EPreservedSAt), true);
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.PreservedEndAt * this._time_scale, this._TimerCallback, null, XArtsSkill.EArtsSkillTimerCb.EPreservedSEnd), true);
				}
			}
			//bool flag8 = !XSingleton<XGame>.singleton.SyncMode || this._demonstration;
			if (!XSingleton<XGame>.singleton.SyncMode || this._demonstration)
			{
				//bool flag9 = !this._demonstration;
				if (!this._demonstration)
				{
					//bool flag10 = this._data.Logical != null;
					if (this._data.Logical != null)
					{
						//bool flag11 = !string.IsNullOrEmpty(this._data.Logical.Exstring);
						if (!string.IsNullOrEmpty(this._data.Logical.Exstring))
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.Exstring_At * this._time_scale, this._TimerCallback, this._data.Logical.Exstring, XArtsSkill.EArtsSkillTimerCb.EExString), true);
						}
					}
					//bool flag12 = this._data.Manipulation != null;
					if (this._data.Manipulation != null)
					{
						for (int l = 0; l < this._data.Manipulation.Count; l++)
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Manipulation[l].At * this._time_scale, this._TimerCallback, this._data.Manipulation[l], XArtsSkill.EArtsSkillTimerCb.EManipulate), true);
						}
					}
					//bool flag13 = this._data.Chain != null && this._data.Chain.TemplateID > 0 && !string.IsNullOrEmpty(this._data.Chain.Name);
					if (this._data.Chain != null && this._data.Chain.TemplateID > 0 && !string.IsNullOrEmpty(this._data.Chain.Name))
					{
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Chain.At * this._time_scale, this._TimerCallback, this._data.Chain, XArtsSkill.EArtsSkillTimerCb.ECastChain), true);
					}
				}
				//bool flag14 = this._data.Mob != null;
				if (this._data.Mob != null)
				{
					for (int m = 0; m < this._data.Mob.Count; m++)
					{
						//bool flag15 = this._data.Mob[m].TemplateID > 0;
						if (this._data.Mob[m].TemplateID > 0)
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Mob[m].At * this._time_scale, this._TimerCallback, this._data.Mob[m], XArtsSkill.EArtsSkillTimerCb.EMob), true);
						}
					}
				}
			}
			//bool flag16 = this._data.Logical != null && this._data.Logical.Not_Selected_End > 0f;
			if (this._data.Logical != null && this._data.Logical.Not_Selected_End > 0f)
			{
				base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.Not_Selected_At * this._time_scale, this._TimerCallback, this._core, XArtsSkill.EArtsSkillTimerCb.ENotSelected), true);
				base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Logical.Not_Selected_End * this._time_scale, this._TimerCallback, null, XArtsSkill.EArtsSkillTimerCb.ENotSelected), true);
			}
			//bool flag17 = this._data.Fx != null && this._firer.IsVisible && !this._firer.MobShield;
			if (this._data.Fx != null && this._firer.IsVisible && !this._firer.MobShield)
			{
				bool flag18 = !XSingleton<XInput>.singleton.FxShield(this._firer);
				for (int n = 0; n < this._data.Fx.Count; n++)
				{
					//bool flag19 = !this._data.Fx[n].Shield || flag18;
					if (!this._data.Fx[n].Shield || flag18)
					{
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Fx[n].At * this._time_scale, this._TimerCallback, this._data.Fx[n], XArtsSkill.EArtsSkillTimerCb.EFx), false);
					}
				}
			}
			//bool flag20 = this._data.Audio != null && !this._firer.MobShield;
			if (this._data.Audio != null && !this._firer.MobShield)
			{
				for (int num = 0; num < this._data.Audio.Count; num++)
				{
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Audio[num].At * this._time_scale, this._TimerCallback, this._data.Audio[num], XArtsSkill.EArtsSkillTimerCb.EAudio), false);
				}
			}
			//bool flag21 = this._data.Warning != null;
			if (this._data.Warning != null)
			{
				for (int num2 = 0; num2 < this._data.Warning.Count; num2++)
				{
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Warning[num2].At * this._time_scale, this._TimerCallback, this._data.Warning[num2], XArtsSkill.EArtsSkillTimerCb.EWarning), false);
				}
			}
			//bool flag22 = this._demonstration || this._firer.IsPlayer || this._firer.IsBoss;
			if (this._demonstration || this._firer.IsPlayer || this._firer.IsBoss)
			{
				//bool flag23 = this._data.CameraEffect != null;
				if (this._data.CameraEffect != null)
				{
					for (int num3 = 0; num3 < this._data.CameraEffect.Count; num3++)
					{
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraEffect[num3].At * this._time_scale, this._TimerCallback, this._data.CameraEffect[num3], XArtsSkill.EArtsSkillTimerCb.EShake), false);
					}
				}
				//bool flag24 = this._demonstration || this._firer.IsPlayer;
				if (this._demonstration || this._firer.IsPlayer)
				{
					//bool flag25 = this._data.CameraMotion != null && !string.IsNullOrEmpty(this._data.CameraMotion.Motion3D);
					if (this._data.CameraMotion != null && !string.IsNullOrEmpty(this._data.CameraMotion.Motion3D))
					{
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraMotion.At * this._time_scale, this._TimerCallback, this._core, XArtsSkill.EArtsSkillTimerCb.ECameraMotion), false);
					}
					//bool flag26 = this._data.CameraPostEffect != null;
					if (this._data.CameraPostEffect != null)
					{
						//bool flag27 = !this._demonstration && !string.IsNullOrEmpty(this._data.CameraPostEffect.Effect);
						if (!this._demonstration && !string.IsNullOrEmpty(this._data.CameraPostEffect.Effect))
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraPostEffect.At * this._time_scale, this._TimerCallback, this._core, XArtsSkill.EArtsSkillTimerCb.ECameraPostEffect), false);
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraPostEffect.End * this._time_scale, this._TimerCallback, this._core, XArtsSkill.EArtsSkillTimerCb.EEndCameraPostEffect), false);
						}
						//bool flag28 = !this._demonstration && this._data.CameraPostEffect.SolidBlack;
						if (!this._demonstration && this._data.CameraPostEffect.SolidBlack)
						{
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraPostEffect.Solid_At * this._time_scale, this._TimerCallback, this._core, XArtsSkill.EArtsSkillTimerCb.ESolidBlack), false);
							base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.CameraPostEffect.Solid_End * this._time_scale, this._TimerCallback, null, XArtsSkill.EArtsSkillTimerCb.ESolidBlack), false);
						}
					}
				}
			}
			//bool flag29 = this._data.Logical.SuppressPlayer && !this._demonstration;
			if (this._data.Logical.SuppressPlayer && !this._demonstration)
			{
				XSingleton<XEntityMgr>.singleton.DummilizePlayer(true);
			}
		}

		// Token: 0x0600C9CA RID: 51658 RVA: 0x002D72F8 File Offset: 0x002D54F8
		protected override void Stop(bool cleanUp)
		{
			//bool set_camera_effect = this._set_camera_effect;
			if (this._set_camera_effect)
			{
				XCameraMotionEndEventArgs @event = XEventPool<XCameraMotionEndEventArgs>.GetEvent();
				@event.Target = this._firer;
				@event.Firer = this._affect_camera;
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
				this._affect_camera.Ator.speed = 1f;
				//bool flag = this._firer.IsPlayer && this._end_solo_effect;
				if (this._firer.IsPlayer && this._end_solo_effect)
				{
					XSingleton<XScene>.singleton.GameCamera.TrySolo();
				}
			}
			this._end_solo_effect = false;
			this._set_camera_effect = false;
			//bool set_camera_shake = this._set_camera_shake;
			if (this._set_camera_shake)
			{
				XCameraShakeEventArgs event2 = XEventPool<XCameraShakeEventArgs>.GetEvent();
				event2.Effect = null;
				event2.Firer = this._affect_camera;
				XSingleton<XEventMgr>.singleton.FireEvent(event2);
			}
			this._set_camera_shake = false;
			//bool flag2 = this._core == this.MainCore;
			if (this._core == this.MainCore)
			{
				//bool flag3 = this._data.Logical != null && this._data.Logical.QTEData != null && this._data.Logical.QTEData.Count != 0;
				if (this._data.Logical != null && this._data.Logical.QTEData != null && this._data.Logical.QTEData.Count != 0)
				{
					this.QTEOff(null);
				}
				//bool demonstration = this._demonstration;
				if (this._demonstration)
				{
					XAttackShowEndArgs event3 = XEventPool<XAttackShowEndArgs>.GetEvent();
					event3.Firer = this._firer;
					event3.ForceQuit = false;
					XSingleton<XEventMgr>.singleton.FireEvent(event3);
				}
			}
			for (int i = 0; i < this._fx.Count; i++)
			{
				XFx xfx = this._fx[i] as XFx;
				//bool flag4 = xfx != null;
				if (xfx != null)
				{
					XSingleton<XFxMgr>.singleton.DestroyFx(xfx, cleanUp);
				}
			}
			//bool flag5 = this._data.Manipulation != null && this._data.Manipulation.Count > 0;
			if (this._data.Manipulation != null && this._data.Manipulation.Count > 0)
			{
				XManipulationOffEventArgs event4 = XEventPool<XManipulationOffEventArgs>.GetEvent();
				event4.DenyToken = 0L;
				XSingleton<XEventMgr>.singleton.FireEvent(event4);
			}
			//bool flag6 = this._data.Logical != null && this._core.PreservedStrength > 0;
			if (this._data.Logical != null && this._core.PreservedStrength > 0)
			{
				this.PreservedSEnd(null);
			}
			//bool flag7 = this._mob_unit.Count > 0;
			if (this._mob_unit.Count > 0)
			{
				for (int j = 0; j < this._mob_unit.Count; j++)
				{
					XEntity xentity = this._mob_unit[j] as XEntity;
					//bool lifewithinMobbedSkill = xentity.LifewithinMobbedSkill;
					if (xentity.LifewithinMobbedSkill)
					{
						XSingleton<XEntityMgr>.singleton.DestroyEntity(xentity);
					}
				}
			}
			this._mob_unit.Clear();
			XSingleton<XAudioMgr>.singleton.StopSound(this._firer, AudioChannel.Skill);
			//bool flag8 = this._data.Logical != null && this._data.Logical.SuppressPlayer && !this._demonstration;
			if (this._data.Logical != null && this._data.Logical.SuppressPlayer && !this._demonstration)
			{
				XSingleton<XEntityMgr>.singleton.DedummilizePlayer();
			}
			//bool flag9 = this._data.CameraPostEffect != null;
			if (this._data.CameraPostEffect != null)
			{
				//bool flag10 = !this._demonstration && !string.IsNullOrEmpty(this._data.CameraPostEffect.Effect);
				if (!this._demonstration && !string.IsNullOrEmpty(this._data.CameraPostEffect.Effect))
				{
					this._core.EndCameraPostEffect();
				}
				//bool flag11 = !this._demonstration && this._data.CameraPostEffect.SolidBlack;
				if (!this._demonstration && this._data.CameraPostEffect.SolidBlack)
				{
					this._affect_camera.SolidCancel();
				}
			}
			this._fx.Clear();
			//bool set_not_selected = this._set_not_selected;
			if (this._set_not_selected)
			{
				this._firer.CanSelected = true;
			}
			this._set_not_selected = false;
		}

		// Token: 0x0600C9CB RID: 51659 RVA: 0x002D768C File Offset: 0x002D588C
		protected override bool Present()
		{
			return !XSingleton<XCommon>.singleton.IsGreater(this._timeElapsed, this.MainCore.Soul.Time * this._time_scale);
		}

		// Token: 0x0600C9CC RID: 51660 RVA: 0x002D76C8 File Offset: 0x002D58C8
		protected override void Result(XResultData data)
		{
			XSingleton<XDebug>.singleton.AddLog("Result --------------------: ", null, null, null, null, null);
			//bool loop = data.Loop;
			if (data.Loop)
			{
				int num = data.Index << 16;
				this.LoopResults(num);
			}
			else if (data.Group)
			{
				this.GroupResults(data.Index << 16);
			}
			else if (data.LongAttackEffect)
			{
				this.Project(data, 0, 0, 0);
			}
			else
			{
				XSkill.SkillResult(this._token, this._firer, this._core, data.Index, this.MainCore.ID, data.Token, this._firer.Rotate.GetMeaningfulFaceVector3(), this._firer.EngineObject.Position);
			}
		}

		// Token: 0x0600C9CD RID: 51661 RVA: 0x002D7794 File Offset: 0x002D5994
		private void Project(XResultData param, int additional = 0, int loop = 0, int group = 0)
		{
			if (param.LongAttackData != null)
			{
				//bool attack_All = param.Attack_All;
				if (param.Attack_All)
				{
					List<XEntity> opponent = XSingleton<XEntityMgr>.singleton.GetOpponent(this._firer);
					int i = 0;
					while (i < opponent.Count)
					{
						//bool flag2 = XEntity.ValideEntity(opponent[i]);
						if (XEntity.ValideEntity(opponent[i]))
						{
							bool flag3 = opponent[i].MobbedBy != null && !param.Mobs_Inclusived;
							if (!flag3)
							{
								XSingleton<XBulletMgr>.singleton.ShootBullet(this.GenerateBullet(param, opponent[i], additional, loop, group, -1, true));
							}
						}
						//IL_8D:
						i++;
						continue;
						//goto IL_8D;
					}
				}
				else
				{
					//bool warning = param.Warning;
					if (param.Warning)
					{
						for (int j = 0; j < this._core.WarningPosAt[param.Warning_Idx].Count; j++)
						{
							XSingleton<XBulletMgr>.singleton.ShootBullet(this.GenerateBullet(param, null, additional, loop, group, j, true));
						}
					}
					else
					{
						//bool reinforce = param.LongAttackData.Reinforce;
						if (param.LongAttackData.Reinforce)
						{
							//bool flag4 = loop == 0 && group == 0;
							if (loop == 0 && group == 0)
							{
								List<XEntity> opponent2 = XSingleton<XEntityMgr>.singleton.GetOpponent(this._firer);
								for (int k = 0; k < opponent2.Count; k++)
								{
									//bool flag5 = XEntity.ValideEntity(opponent2[k]) && opponent2[k].Buffs != null && opponent2[k].Buffs.IsBuffStateOn(XBuffType.XBuffType_Mark);
									if (XEntity.ValideEntity(opponent2[k]) && opponent2[k].Buffs != null && opponent2[k].Buffs.IsBuffStateOn(XBuffType.XBuffType_Mark))
									{
										XSingleton<XBulletMgr>.singleton.ShootBullet(this.GenerateBullet(param, opponent2[k], additional, 0, 0, -1, true));
									}
								}
							}
						}
						else
						{
							XSingleton<XBulletMgr>.singleton.ShootBullet(this.GenerateBullet(param, base.Target, additional, loop, group, -1, false));
						}
					}
				}
			}
		}

		// Token: 0x0600C9CE RID: 51662 RVA: 0x002D7980 File Offset: 0x002D5B80
		private void LoopResults(object param)
		{
			int num = (int)param;
			int num2 = num >> 16;
			int num3 = num & 65535;
			//bool flag = !this._data.Result[num2].Loop || this._data.Result[num2].Cycle <= 0f || num3 >= this._data.Result[num2].Loop_Count;
			if (/*!flag*/this._data.Result[num2].Loop && this._data.Result[num2].Cycle > 0f && num3 < this._data.Result[num2].Loop_Count)
			{
				//bool group = this._data.Result[num2].Group;
				if (this._data.Result[num2].Group)
				{
					this.GroupResults(num2 << 16 | num3 << 8 | 0);
				}
				else
				{
					//bool longAttackEffect = this._data.Result[num2].LongAttackEffect;
					if (this._data.Result[num2].LongAttackEffect)
					{
						this.Project(this._data.Result[num2], 0, num3, 0);
					}
					else
					{
						XSkill.SkillResult(this._token, this._firer, this._core, num2, this.MainCore.ID, this._data.Result[num2].Token, this._firer.EngineObject.Forward, this._firer.EngineObject.Position);
					}
				}
				//bool flag2 = !this._demonstration && !XEntity.ValideEntity(this._firer);
				if (/*!flag2*/this._demonstration || XEntity.ValideEntity(this._firer))
				{
					num3++;
					//bool flag3 = num3 < this._data.Result[num2].Loop_Count;
					if (num3 < this._data.Result[num2].Loop_Count)
					{
						num = (num2 << 16 | num3);
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Result[num2].Cycle * this._time_scale, this._TimerCallback, num, XArtsSkill.EArtsSkillTimerCb.ELoopResults), true);
					}
				}
			}
		}

		// Token: 0x0600C9CF RID: 51663 RVA: 0x002D7B58 File Offset: 0x002D5D58
		private void GroupResults(object param)
		{
			int num = (int)param;
			int num2 = num >> 16;
			int num3 = num & 255;
			int num4 = (num & 65280) >> 8;
			//bool flag = !this._data.Result[num2].Group || num3 >= this._data.Result[num2].Group_Count;
			if (/*!flag*/this._data.Result[num2].Group && num3 < this._data.Result[num2].Group_Count)
			{
				Vector3 forward = this._firer.EngineObject.Forward;
				int num5 = this._data.Result[num2].Deviation_Angle + this._data.Result[num2].Angle_Step * num3;
				num5 = (this._data.Result[num2].Clockwise ? num5 : (-num5));
				//bool longAttackEffect = this._data.Result[num2].LongAttackEffect;
				if (this._data.Result[num2].LongAttackEffect)
				{
					this.Project(this._data.Result[num2], num5, num4, num3);
				}
				else
				{
					XSkill.SkillResult(this._token, this._firer, this._core, num2, this.MainCore.ID, this._data.Result[num2].Token, XSingleton<XCommon>.singleton.HorizontalRotateVetor3(forward, (float)num5, true), this._firer.EngineObject.Position);
				}
				//bool flag2 = !this._demonstration && !XEntity.ValideEntity(this._firer);
				if (/*!flag2*/this._demonstration || XEntity.ValideEntity(this._firer))
				{
					num3++;
					//bool flag3 = num3 < this._data.Result[num2].Group_Count;
					if (num3 < this._data.Result[num2].Group_Count)
					{
						num = (num2 << 16 | num4 << 8 | num3);
						base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(this._data.Result[num2].Time_Step * this._time_scale, this._TimerCallback, num, XArtsSkill.EArtsSkillTimerCb.EGroupResults), true);
					}
				}
			}
		}

		// Token: 0x0600C9D0 RID: 51664 RVA: 0x002D7D4C File Offset: 0x002D5F4C
		protected void Charge(object o)
		{
			XChargeData xchargeData = o as XChargeData;
			this.ChargeTo(xchargeData.Index);
		}

		// Token: 0x0600C9D1 RID: 51665 RVA: 0x002D7D70 File Offset: 0x002D5F70
		protected void QTEOn(object o)
		{
			//bool flag = !this._firer.Destroying && this._firer.QTE != null;
			if (!this._firer.Destroying && this._firer.QTE != null)
			{
				XSkillQTEEventArgs @event = XEventPool<XSkillQTEEventArgs>.GetEvent();
				@event.Firer = this._firer;
				@event.State = (uint)((o != null) ? ((int)o) : 0);
				@event.On = true;
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
		}

		// Token: 0x0600C9D2 RID: 51666 RVA: 0x002D7DDC File Offset: 0x002D5FDC
		protected void QTEOff(object o)
		{
			//bool flag = !this._firer.Destroying && this._firer.QTE != null;
			if (!this._firer.Destroying && this._firer.QTE != null)
			{
				XSkillQTEEventArgs @event = XEventPool<XSkillQTEEventArgs>.GetEvent();
				@event.Firer = this._firer;
				@event.State = (uint)((o != null) ? ((int)o) : 0);
				@event.On = false;
				XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
		}

		// Token: 0x0600C9D3 RID: 51667 RVA: 0x002D7E48 File Offset: 0x002D6048
		protected void ChargeTo(int o)
		{
			int index = o & 255;
			float timeGone = (float)(o >> 16) / 1000f;
			XChargeEventArgs @event = XEventPool<XChargeEventArgs>.GetEvent();
			@event.Token = this._token;
			@event.Data = this._data.Charge[index];
			@event.TimeGone = timeGone;
			@event.TimeScale = this._time_scale;
			@event.AimedTarget = (@event.Data.AimTarget ? base.Target : null);
			@event.TimeSpan = this._data.Charge[index].End - (this._data.Charge[index].Using_Curve ? 0f : this._data.Charge[index].At);
			@event.Firer = this._firer;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
		}

		// Token: 0x0600C9D4 RID: 51668 RVA: 0x002D7F34 File Offset: 0x002D6134
		protected void Audio(object o)
		{
			XAudioData xaudioData = o as XAudioData;
			XSingleton<XAudioMgr>.singleton.PlaySound(this._firer, xaudioData.Channel, xaudioData.Clip);
		}

		// Token: 0x0600C9D5 RID: 51669 RVA: 0x002D7F68 File Offset: 0x002D6168
		protected void PreservedSAt(object o)
		{
			int num = (int)o;
			XStrengthPresevationOnArgs @event = XEventPool<XStrengthPresevationOnArgs>.GetEvent();
			@event.Host = this._firer;
			@event.Firer = XSingleton<XGame>.singleton.Doc;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
			XAttrChangeEventArgs event2 = XEventPool<XAttrChangeEventArgs>.GetEvent();
			event2.AttrKey = XAttributeDefine.XAttr_CurrentXULI_Basic;
			event2.DeltaValue = (double)num - this._firer.Attributes.GetAttr(XAttributeDefine.XAttr_CurrentXULI_Basic);
			event2.Firer = this._firer;
			XSingleton<XEventMgr>.singleton.FireEvent(event2);
		}

		// Token: 0x0600C9D6 RID: 51670 RVA: 0x002D7FF0 File Offset: 0x002D61F0
		protected void PreservedSEnd(object o)
		{
			XStrengthPresevationOffArgs @event = XEventPool<XStrengthPresevationOffArgs>.GetEvent();
			@event.Host = this._firer;
			@event.Firer = XSingleton<XGame>.singleton.Doc;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
		}

		// Token: 0x0600C9D7 RID: 51671 RVA: 0x002D802D File Offset: 0x002D622D
		protected void ExString(object o)
		{
			XSingleton<XLevelScriptMgr>.singleton.SetExternalString(o as string, false);
		}

		// Token: 0x0600C9D8 RID: 51672 RVA: 0x002D8044 File Offset: 0x002D6244
		protected void Manipulate(object o)
		{
			XManipulationData xmanipulationData = o as XManipulationData;
			XManipulationOnEventArgs @event = XEventPool<XManipulationOnEventArgs>.GetEvent();
			@event.data = xmanipulationData;
			@event.Firer = this._firer;
			long token = @event.Token;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
			base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>((xmanipulationData.End - xmanipulationData.At) * this._time_scale, this._TimerCallback, token, XArtsSkill.EArtsSkillTimerCb.EKillManipulate), true);
		}

		// Token: 0x0600C9D9 RID: 51673 RVA: 0x002D80BC File Offset: 0x002D62BC
		protected void MoveMob()
		{
			XMoveMobEventArgs @event = XEventPool<XMoveMobEventArgs>.GetEvent();
			@event.Firer = this._firer;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
		}

		// Token: 0x0600C9DA RID: 51674 RVA: 0x002D80EC File Offset: 0x002D62EC
		protected void Mob(object o)
		{
			XMobUnitData xmobUnitData = o as XMobUnitData;
			//bool flag = (long)xmobUnitData.TemplateID == (long)((ulong)XArtsSkill._move_mob_id);
			if ((long)xmobUnitData.TemplateID == (long)((ulong)XArtsSkill._move_mob_id))
			{
				this.MoveMob();
			}
			else
			{
				Vector3 vector = this._firer.EngineObject.Rotation * new Vector3(xmobUnitData.Offset_At_X, xmobUnitData.Offset_At_Y, xmobUnitData.Offset_At_Z);
				Vector3 vector2 = this._firer.EngineObject.Position + vector;
				//bool flag2 = !this._demonstration;
				if (!this._demonstration)
				{
					float num = 0f;
					//bool flag3 = !XSingleton<XScene>.singleton.TryGetTerrainY(vector2, out num) || num < 0f;
					if (!XSingleton<XScene>.singleton.TryGetTerrainY(vector2, out num) || num < 0f)
					{
						vector2 = this._firer.EngineObject.Position;
					}
				}
				XEntity xentity = this._demonstration ? XSingleton<XEntityMgr>.singleton.CreateDummy((uint)xmobUnitData.TemplateID, vector2, this._firer.EngineObject.Rotation) : XSingleton<XEntityMgr>.singleton.CreateEntityByCaller(this._firer, (uint)xmobUnitData.TemplateID, vector2, this._firer.EngineObject.Rotation, true, this._firer.Attributes.FightGroup);
				//bool flag4 = xentity != null;
				if (xentity != null)
				{
					//bool isDummy = xentity.IsDummy;
					if (xentity.IsDummy)
					{
						xentity.LifewithinMobbedSkill = true;
						xentity.MobShield = false;
					}
					else
					{
						xentity.MobShieldable = xmobUnitData.Shield;
						xentity.MobShield = XSingleton<XInput>.singleton.MobShield(xentity);
						xentity.LifewithinMobbedSkill = xmobUnitData.LifewithinSkill;
					}
					//bool flag5 = this._firer.Skill.AddSkillMob(xentity);
					if (this._firer.Skill.AddSkillMob(xentity))
					{
						//bool flag6 = !xentity.IsDummy;
						if (!xentity.IsDummy)
						{
							XSingleton<XSkillEffectMgr>.singleton.SetMobProperty(xentity, this._firer, this._core.ID);
							//bool isBoss = this._firer.IsBoss;
							if (this._firer.IsBoss)
							{
								XSecurityAIInfo xsecurityAIInfo = XSecurityAIInfo.TryGetStatistics(this._firer);
								//bool flag7 = xsecurityAIInfo != null;
								if (xsecurityAIInfo != null)
								{
									xsecurityAIInfo.OnExternalCallMonster();
								}
							}
						}
						this._mob_unit.Add(xentity);
					}
				}
			}
		}

		// Token: 0x0600C9DB RID: 51675 RVA: 0x002D82FC File Offset: 0x002D64FC
		protected void CastChain(object o)
		{
			//bool flag = this._firer.Skill.SkillMobs == null;
			if (/*!flag*/this._firer.Skill.SkillMobs != null)
			{
				XCastChain xcastChain = o as XCastChain;
				for (int i = 0; i < this._firer.Skill.SkillMobs.Count; i++)
				{
					//bool flag2 = (ulong)this._firer.Skill.SkillMobs[i].TypeID == (ulong)((long)xcastChain.TemplateID) && XEntity.ValideEntity(this._firer.Skill.SkillMobs[i]);
					if ((ulong)this._firer.Skill.SkillMobs[i].TypeID == (ulong)((long)xcastChain.TemplateID) && XEntity.ValideEntity(this._firer.Skill.SkillMobs[i]))
					{
						XAttackEventArgs @event = XEventPool<XAttackEventArgs>.GetEvent();
						@event.Identify = XSingleton<XCommon>.singleton.XHash(xcastChain.Name);
						@event.Firer = this._firer.Skill.SkillMobs[i];
						@event.Target = null;
						XSingleton<XEventMgr>.singleton.FireEvent(@event);
					}
				}
			}
		}

		// Token: 0x0600C9DC RID: 51676 RVA: 0x002D83F8 File Offset: 0x002D65F8
		private XFx FilterFx(Vector3 pos, string path)
		{
			//bool flag = string.IsNullOrEmpty(path);
			XFx result;
			if (string.IsNullOrEmpty(path))
			{
				result = null;
			}
			else
			{
				//bool flag2 = XSingleton<XScene>.singleton.FilterFx && this._firer != null && !this._firer.IsPlayer && !this._firer.IsBoss && !(this._firer is XDummy);
				if (XSingleton<XScene>.singleton.FilterFx && this._firer != null && !this._firer.IsPlayer && !this._firer.IsBoss && !(this._firer is XDummy))
				{
					Vector3 position = XSingleton<XEntityMgr>.singleton.Player.EngineObject.Position;
					float num = (pos.x - position.x) * (pos.x - position.x) + (pos.z - position.z) * (pos.z - position.z);
					//bool flag3 = num < XFxMgr.FilterFxDis4;
					if (num < XFxMgr.FilterFxDis4)
					{
						result = XSingleton<XFxMgr>.singleton.CreateFx(path, null, true);
					}
					else
					{
						result = null;
					}
				}
				else
				{
					result = XSingleton<XFxMgr>.singleton.CreateFx(path, null, true);
				}
			}
			return result;
		}

		// Token: 0x0600C9DD RID: 51677 RVA: 0x002D84E4 File Offset: 0x002D66E4
		protected void Fx(object o)
		{
			XFxData xfxData = o as XFxData;
			Vector3 zero = Vector3.zero;
			XGameObject xgameObject = this._firer.IsTransform ? this._firer.Transformer.EngineObject : this._firer.EngineObject;
			SkillFxType type = xfxData.Type;
			if (type != SkillFxType.FirerBased)
			{
				if (type == SkillFxType.TargetBased)
				{
					//bool flag = this._data.NeedTarget && base.HasValidTarget();
					if (this._data.NeedTarget && base.HasValidTarget())
					{
						zero = new Vector3(xfxData.Target_OffsetX, xfxData.Target_OffsetY, xfxData.Target_OffsetZ);
						xgameObject = (base.Target.IsTransform ? base.Target.Transformer.EngineObject : base.Target.EngineObject);
					}
					else
					{
						zero = new Vector3(xfxData.OffsetX, xfxData.OffsetY, xfxData.OffsetZ);
						xgameObject = (this._firer.IsTransform ? this._firer.Transformer.EngineObject : this._firer.EngineObject);
					}
				}
			}
			else
			{
				zero = new Vector3(xfxData.OffsetX, xfxData.OffsetY, xfxData.OffsetZ);
				xgameObject = (this._firer.IsTransform ? this._firer.Transformer.EngineObject : this._firer.EngineObject);
			}
			//bool flag2 = !this._demonstration && xfxData.StickToGround;
			XFx xfx;
			if (!this._demonstration && xfxData.StickToGround)
			{
				zero.y = 0f;
				Vector3 vector = xgameObject.Position + xgameObject.Rotation * zero;
				vector.y = XSingleton<XScene>.singleton.TerrainY(vector);
				Quaternion rotation = XSingleton<XCommon>.singleton.RotateToGround(vector, xgameObject.Forward);
				xfx = this.FilterFx(vector, xfxData.Fx);
				//bool flag3 = xfx == null;
				if (xfx == null)
				{
					return;
				}
				xfx.DelayDestroy = xfxData.Destroy_Delay * this._time_scale;
				xfx.Play(vector, rotation, new Vector3(xfxData.ScaleX, xfxData.ScaleY, xfxData.ScaleZ), this._time_scale);
			}
			else
			{
				xfx = this.FilterFx(xgameObject.Position, xfxData.Fx);
				//bool flag4 = xfx == null;
				if (xfx == null)
				{
					return;
				}
				xfx.DelayDestroy = xfxData.Destroy_Delay * this._time_scale;
				xfx.Play(xgameObject, zero, new Vector3(xfxData.ScaleX, xfxData.ScaleY, xfxData.ScaleZ), this._time_scale, xfxData.Follow, false, xfxData.Bone, 0f);
			}
			this.RegisterFx(xfx, ((xfxData.End > 0f && xfxData.End < (xfxData.Combined ? this.MainCore.Soul.Time : this._core.Soul.Time)) ? (xfxData.End - xfxData.At) : -1f) * this._time_scale, xfxData.Combined);
		}

		// Token: 0x0600C9DE RID: 51678 RVA: 0x002D87DC File Offset: 0x002D69DC
		protected void Warning(object o)
		{
			XWarningData xwarningData = o as XWarningData;
			this._core.WarningPosAt[xwarningData.Index].Clear();
			//bool flag = xwarningData.RandomWarningPos || xwarningData.Type == XWarningType.Warning_Multiple;
			if (xwarningData.RandomWarningPos || xwarningData.Type == XWarningType.Warning_Multiple)
			{
				ulong num = 0UL;
				List<XSkillCore.XWarningRandomPackage> list = this._core.WarningRandomAt[xwarningData.Index];
				for (int i = 0; i < list.Count; i++)
				{
					XEntity xentity = (list[i].ID == 0UL) ? base.Target : XSingleton<XEntityMgr>.singleton.GetEntity(list[i].ID);
					for (int j = 0; j < list[i].Pos.Count; j++)
					{
						num += 1UL;
						//bool flag2 = xentity != null;
						if (xentity != null)
						{
							uint num2 = list[i].Pos[j];
							float num3 = (num2 & 65535U) / 10f;
							uint num4 = num2 >> 16;
							XSkillCore.XSkillWarningPackage xskillWarningPackage = default(XSkillCore.XSkillWarningPackage);
							Vector3 vector = num3 * XSingleton<XCommon>.singleton.HorizontalRotateVetor3(Vector3.forward, num4, true);
							float num5 = xentity.EngineObject.Position.x + vector.x;
							float num6 = xentity.EngineObject.Position.z + vector.z;
							float num7 = 0f;
							//bool flag3 = !XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num5, num7, num6), out num7) || num7 < 0f;
							if (!XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num5, num7, num6), out num7) || num7 < 0f)
							{
								num7 = xentity.EngineObject.Position.y;
							}
							xskillWarningPackage.WarningAt = new Vector3(num5, num7, num6);
							xskillWarningPackage.WarningTo = num;
							this._core.WarningPosAt[xwarningData.Index].Add(xskillWarningPackage);
							XFx xfx = this.FilterFx(xskillWarningPackage.WarningAt, xwarningData.Fx);
							//bool flag4 = xfx != null;
							if (xfx != null)
							{
								xfx.Play(xskillWarningPackage.WarningAt, this._demonstration ? Quaternion.identity : XSingleton<XCommon>.singleton.RotateToGround(xskillWarningPackage.WarningAt, Vector3.forward), xwarningData.Scale * Vector3.one, this._time_scale);
								//bool flag5 = xfx != null;
								if (xfx != null)
								{
									this.RegisterFx(xfx, xwarningData.FxDuration * this._time_scale, false);
								}
							}
						}
					}
				}
			}
			else
			{
				switch (xwarningData.Type)
				{
				case XWarningType.Warning_None:
				{
					XSkillCore.XSkillWarningPackage xskillWarningPackage2 = default(XSkillCore.XSkillWarningPackage);
					Vector3 vector2 = this._firer.EngineObject.Rotation * new Vector3(xwarningData.OffsetX, xwarningData.OffsetY, xwarningData.OffsetZ);
					float num8 = this._firer.EngineObject.Position.x + vector2.x;
					float num9 = this._firer.EngineObject.Position.z + vector2.z;
					float num10 = 0f;
					//bool flag6 = (!this._demonstration && !XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num8, num10, num9), out num10)) || num10 < 0f;
					if ((!this._demonstration && !XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num8, num10, num9), out num10)) || num10 < 0f)
					{
						num10 = this._firer.EngineObject.Position.y;
					}
					num10 = (this._demonstration ? this._firer.EngineObject.Position.y : (num10 + vector2.y));
					xskillWarningPackage2.WarningAt = new Vector3(num8, num10, num9);
					xskillWarningPackage2.WarningTo = 0UL;
					this._core.WarningPosAt[xwarningData.Index].Add(xskillWarningPackage2);
					XFx xfx2 = this.FilterFx(xskillWarningPackage2.WarningAt, xwarningData.Fx);
					//bool flag7 = xfx2 != null;
					if (xfx2 != null)
					{
						xfx2.Play(xskillWarningPackage2.WarningAt, this._demonstration ? Quaternion.identity : XSingleton<XCommon>.singleton.RotateToGround(xskillWarningPackage2.WarningAt, Vector3.forward), xwarningData.Scale * Vector3.one, this._time_scale);
						//bool flag8 = xfx2 != null;
						if (xfx2 != null)
						{
							this.RegisterFx(xfx2, xwarningData.FxDuration * this._time_scale, false);
						}
					}
					break;
				}
				case XWarningType.Warning_Target:
				{
					XSkillCore.XSkillWarningPackage xskillWarningPackage3 = default(XSkillCore.XSkillWarningPackage);
					//bool flag9 = base.HasValidTarget();
					if (base.HasValidTarget())
					{
						xskillWarningPackage3.WarningAt = new Vector3(base.Target.EngineObject.Position.x, XSingleton<XScene>.singleton.TerrainY(base.Target.EngineObject.Position), base.Target.EngineObject.Position.z);
						xskillWarningPackage3.WarningTo = base.Target.ID;
						this._core.WarningPosAt[xwarningData.Index].Add(xskillWarningPackage3);
					}
					else
					{
						Vector3 vector3 = this._firer.EngineObject.Rotation * new Vector3(xwarningData.OffsetX, xwarningData.OffsetY, xwarningData.OffsetZ);
						float num11 = this._firer.EngineObject.Position.x + vector3.x;
						float num12 = this._firer.EngineObject.Position.z + vector3.z;
						float num13 = 0f;
						//bool flag10 = (!this._demonstration && !XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num11, num13, num12), out num13)) || num13 < 0f;
						if ((!this._demonstration && !XSingleton<XScene>.singleton.TryGetTerrainY(new Vector3(num11, num13, num12), out num13)) || num13 < 0f)
						{
							num13 = this._firer.EngineObject.Position.y;
						}
						num13 = (this._demonstration ? this._firer.EngineObject.Position.y : (num13 + vector3.y));
						xskillWarningPackage3.WarningAt = new Vector3(num11, num13, num12);
						xskillWarningPackage3.WarningTo = 0UL;
						this._core.WarningPosAt[xwarningData.Index].Add(xskillWarningPackage3);
					}
					XFx xfx3 = this.FilterFx(xskillWarningPackage3.WarningAt, xwarningData.Fx);
					//bool flag11 = xfx3 != null;
					if (xfx3 != null)
					{
						xfx3.Play(xskillWarningPackage3.WarningAt, this._demonstration ? Quaternion.identity : XSingleton<XCommon>.singleton.RotateToGround(xskillWarningPackage3.WarningAt, Vector3.forward), xwarningData.Scale * Vector3.one, this._time_scale);
						//bool flag12 = xfx3 != null;
						if (xfx3 != null)
						{
							this.RegisterFx(xfx3, xwarningData.FxDuration * this._time_scale, false);
						}
					}
					break;
				}
				case XWarningType.Warning_All:
				{
					List<XEntity> opponent = XSingleton<XEntityMgr>.singleton.GetOpponent(this._firer);
					int k = 0;
					while (k < opponent.Count)
					{
						//bool flag13 = XEntity.ValideEntity(opponent[k]);
						if (XEntity.ValideEntity(opponent[k]))
						{
							bool flag14 = opponent[k].MobbedBy != null && !xwarningData.Mobs_Inclusived;
							if (!flag14)
							{
								XSkillCore.XSkillWarningPackage xskillWarningPackage4 = default(XSkillCore.XSkillWarningPackage);
								xskillWarningPackage4.WarningAt = opponent[k].EngineObject.Position;
								xskillWarningPackage4.WarningAt.y = XSingleton<XScene>.singleton.TerrainY(opponent[k].EngineObject.Position);
								xskillWarningPackage4.WarningTo = opponent[k].ID;
								this._core.WarningPosAt[xwarningData.Index].Add(xskillWarningPackage4);
								XFx xfx4 = this.FilterFx(xskillWarningPackage4.WarningAt, xwarningData.Fx);
								//bool flag15 = xfx4 != null;
								if (xfx4 != null)
								{
									xfx4.Play(xskillWarningPackage4.WarningAt, XSingleton<XCommon>.singleton.RotateToGround(xskillWarningPackage4.WarningAt, Vector3.forward), xwarningData.Scale * Vector3.one, this._time_scale);
									this.RegisterFx(xfx4, xwarningData.FxDuration * this._time_scale, false);
								}
							}
						}
						//IL_7F8:
						k++;
						continue;
						//goto IL_7F8;
					}
					break;
				}
				}
			}
		}

		// Token: 0x0600C9DF RID: 51679 RVA: 0x002D9000 File Offset: 0x002D7200
		protected void CameraMotion(object o)
		{
			//bool flag = !XSingleton<XLevelFinishMgr>.singleton.IsCurrentLevelFinished;
			if (!XSingleton<XLevelFinishMgr>.singleton.IsCurrentLevelFinished)
			{
				XSkillCore xskillCore = o as XSkillCore;
				this._affect_camera.Ator.speed = base.TimeScale;
				XCameraMotionEventArgs @event = XEventPool<XCameraMotionEventArgs>.GetEvent();
				@event.Motion = (xskillCore.Soul.CameraMotion.Clone() as XCameraMotionData);
				@event.Motion.Follow_Position = true;
				@event.Motion.Coordinate = CameraMotionSpace.World;
				XOperationMode operationMode = XSingleton<XOperationData>.singleton.OperationMode;
				if (operationMode != XOperationMode.X25D)
				{
					if (operationMode - XOperationMode.X3D <= 1)
					{
						@event.Motion.MotionType = @event.Motion.Motion3DType;
						@event.Motion.Motion = @event.Motion.Motion3D;
					}
				}
				else
				{
					@event.Motion.MotionType = (string.IsNullOrEmpty(@event.Motion.Motion2_5D) ? @event.Motion.Motion3DType : @event.Motion.Motion2_5DType);
					@event.Motion.Motion = (string.IsNullOrEmpty(@event.Motion.Motion2_5D) ? @event.Motion.Motion3D : @event.Motion.Motion2_5D);
				}
				CameraMotionType motionType = @event.Motion.MotionType;
				if (motionType != CameraMotionType.AnchorBased)
				{
					if (motionType == CameraMotionType.CameraBased)
					{
						@event.Motion.AutoSync_At_Begin = false;
					}
				}
				else
				{
					@event.Motion.AutoSync_At_Begin = true;
					@event.Motion.LookAt_Target = false;
					//bool flag2 = XSingleton<XScene>.singleton.GameCamera.Solo != null;
					if (XSingleton<XScene>.singleton.GameCamera.Solo != null)
					{
						XSingleton<XScene>.singleton.GameCamera.Solo.Stop();
						this._end_solo_effect = true;
					}
				}
				@event.Target = this._firer;
				@event.Trigger = "ToEffect";
				@event.Firer = this._affect_camera;
				//bool flag3 = xskillCore != this._core;
				if (xskillCore != this._core)
				{
					this._combined_set_camera_effect = XSingleton<XEventMgr>.singleton.FireEvent(@event);
				}
				else
				{
					this._set_camera_effect = XSingleton<XEventMgr>.singleton.FireEvent(@event);
				}
			}
		}

		// Token: 0x0600C9E0 RID: 51680 RVA: 0x002D920C File Offset: 0x002D740C
		protected void CameraPostEffect(object o)
		{
			XSkillCore xskillCore = o as XSkillCore;
			xskillCore.StartCameraPostEffect();
		}

		// Token: 0x0600C9E1 RID: 51681 RVA: 0x002D9228 File Offset: 0x002D7428
		protected void EndCameraPostEffect(object o)
		{
			XSkillCore xskillCore = o as XSkillCore;
			xskillCore.EndCameraPostEffect();
		}

		// Token: 0x0600C9E2 RID: 51682 RVA: 0x002D9244 File Offset: 0x002D7444
		protected void NotSelected(object o)
		{
			this._firer.CanSelected = (o == null);
			//bool flag = !this._firer.CanSelected;
			if (!this._firer.CanSelected)
			{
				XSkillCore xskillCore = o as XSkillCore;
				//bool flag2 = xskillCore == this.MainCore;
				if (xskillCore == this.MainCore)
				{
					this._combined_set_not_selected = true;
				}
				else
				{
					this._set_not_selected = true;
				}
			}
		}

		// Token: 0x0600C9E3 RID: 51683 RVA: 0x002D929C File Offset: 0x002D749C
		protected void Shake(object o)
		{
			XCameraEffectData xcameraEffectData = o as XCameraEffectData;
			XCameraShakeEventArgs @event = XEventPool<XCameraShakeEventArgs>.GetEvent();
			@event.Effect = xcameraEffectData;
			@event.TimeScale = this._time_scale;
			@event.Firer = this._affect_camera;
			//bool combined = xcameraEffectData.Combined;
			if (xcameraEffectData.Combined)
			{
				this._combined_set_camera_shake = XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
			else
			{
				this._set_camera_shake = XSingleton<XEventMgr>.singleton.FireEvent(@event);
			}
		}

		// Token: 0x0600C9E4 RID: 51684 RVA: 0x002D9308 File Offset: 0x002D7508
		protected void SolidBlack(object o)
		{
			//bool flag = o == null;
			if (o == null)
			{
				this._affect_camera.SolidCancel();
			}
			else
			{
				this._affect_camera.SolidBlack();
			}
		}

		// Token: 0x0600C9E5 RID: 51685 RVA: 0x002D9338 File Offset: 0x002D7538
		private void KillManipulate(object o)
		{
			XManipulationOffEventArgs @event = XEventPool<XManipulationOffEventArgs>.GetEvent();
			@event.DenyToken = (long)o;
			@event.Firer = this._firer;
			XSingleton<XEventMgr>.singleton.FireEvent(@event);
		}

		// Token: 0x0600C9E6 RID: 51686 RVA: 0x002D9374 File Offset: 0x002D7574
		private void KillFx(object o)
		{
			XFx xfx = o as XFx;
			this._fx.Remove(xfx);
			this._combined_fx.Remove(xfx);
			XSingleton<XFxMgr>.singleton.DestroyFx(xfx, false);
		}

		// Token: 0x0600C9E7 RID: 51687 RVA: 0x002D93B0 File Offset: 0x002D75B0
		private XBullet GenerateBullet(XResultData data, XEntity target, int additional, int loop, int group, int wid = -1, bool extrainfo = false)
		{
			ulong bulletid = (ulong)((this._firer.Net == null) ? XSingleton<XCommon>.singleton.UniqueToken : ((long)loop << 56 | (long)group << 48 | (long)((long)((ulong)this.GetCombinedId()) << 40) | (long)data.Index << 32 | (long)((ulong)((uint)this._token))));
			int diviation = data.LongAttackData.FireAngle + additional;
			XBullet xbullet = XSingleton<XBulletMgr>.singleton.CreateBullet(bulletid, this._token, this._firer, target, this._core, data, this.MainCore.ID, diviation, this._demonstration, wid);
			if (extrainfo)
			{
				xbullet.ExtraID = (XEntity.ValideEntity(target) ? target.ID : this._core.WarningPosAt[data.Warning_Idx][wid].WarningTo);
			}
			return xbullet;
		}

		// Token: 0x0600C9E8 RID: 51688 RVA: 0x002D948C File Offset: 0x002D768C
		private void RegisterFx(XFx fx, float duration, bool combined)
		{
			if (combined)
			{
				this._combined_fx.Add(fx);
				//bool flag = duration > 0f;
				if (duration > 0f)
				{
					XCombinedSkill xcombinedSkill = this as XCombinedSkill;
					xcombinedSkill.AddedCombinedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(duration, this._TimerCallback, fx, XArtsSkill.EArtsSkillTimerCb.EKillFx));
				}
			}
			else
			{
				this._fx.Add(fx);
				//bool flag2 = duration > 0f;
				if (duration > 0f)
				{
					base.AddedTimerToken(XSingleton<XTimerMgr>.singleton.SetTimer<XArtsSkill.EArtsSkillTimerCb>(duration, this._TimerCallback, fx, XArtsSkill.EArtsSkillTimerCb.EKillFx), false);
				}
			}
		}

		// Token: 0x04005937 RID: 22839
		private SmallBuffer<object> _fx;

		// Token: 0x04005938 RID: 22840
		protected SmallBuffer<object> _combined_fx;

		// Token: 0x04005939 RID: 22841
		private Vector3 _warning_face = Vector3.forward;

		// Token: 0x0400593A RID: 22842
		private Vector3 _warning_pos = Vector3.zero;

		// Token: 0x0400593B RID: 22843
		protected bool _end_solo_effect = false;

		// Token: 0x0400593C RID: 22844
		protected bool _set_camera_effect = false;

		// Token: 0x0400593D RID: 22845
		protected bool _combined_set_camera_effect = false;

		// Token: 0x0400593E RID: 22846
		protected bool _set_camera_shake = false;

		// Token: 0x0400593F RID: 22847
		protected bool _combined_set_camera_shake = false;

		// Token: 0x04005940 RID: 22848
		protected bool _set_not_selected = false;

		// Token: 0x04005941 RID: 22849
		protected bool _combined_set_not_selected = false;

		// Token: 0x04005942 RID: 22850
		public static uint _move_mob_id = 99999999U;

		// Token: 0x04005943 RID: 22851
		private SmallBuffer<object> _mob_unit;

		// Token: 0x020019E3 RID: 6627
		protected enum EArtsSkillTimerCb
		{
			// Token: 0x0400806E RID: 32878
			EOnResult = 2,
			// Token: 0x0400806F RID: 32879
			EQTEOn,
			// Token: 0x04008070 RID: 32880
			EQTEOff,
			// Token: 0x04008071 RID: 32881
			EPreservedSAt,
			// Token: 0x04008072 RID: 32882
			EPreservedSEnd,
			// Token: 0x04008073 RID: 32883
			ENotSelected,
			// Token: 0x04008074 RID: 32884
			EExString,
			// Token: 0x04008075 RID: 32885
			EManipulate,
			// Token: 0x04008076 RID: 32886
			EMob,
			// Token: 0x04008077 RID: 32887
			ECastChain,
			// Token: 0x04008078 RID: 32888
			EFx,
			// Token: 0x04008079 RID: 32889
			EAudio,
			// Token: 0x0400807A RID: 32890
			EWarning,
			// Token: 0x0400807B RID: 32891
			ECharge,
			// Token: 0x0400807C RID: 32892
			EShake,
			// Token: 0x0400807D RID: 32893
			ECameraMotion,
			// Token: 0x0400807E RID: 32894
			ECameraPostEffect,
			// Token: 0x0400807F RID: 32895
			ESolidBlack,
			// Token: 0x04008080 RID: 32896
			ELoopResults,
			// Token: 0x04008081 RID: 32897
			EGroupResults,
			// Token: 0x04008082 RID: 32898
			EKillManipulate,
			// Token: 0x04008083 RID: 32899
			EKillFx,
			// Token: 0x04008084 RID: 32900
			EEndCameraPostEffect,
			// Token: 0x04008085 RID: 32901
			EArtsSkillNum
		}
	}
}
